package com.io;

import java.io.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86184
 * Date: 2023-11-30
 * Time: 10:49
 */
//public class Test {
//    public static void main(String[] args) throws Exception{
//        BufferedReader bufferedReader = new BufferedReader(new FileReader("c:\\Javacode2\\c.txt"));
//        String str;
//        while((str = bufferedReader.readLine()) != null){
//            System.out.println(str);
//        }
//
//        bufferedReader.close();
//    }
//}

public class Test {
    public static void main(String[] args) throws Exception{
        //字节流
        FileInputStream fileInputStream = new FileInputStream("C:\\Javacode2\\c.txt");

        //中间流
        InputStreamReader streamReader = new InputStreamReader(fileInputStream, "gbk");
        //字符流
        BufferedReader reader = new BufferedReader(streamReader);
        String str;
        while((str = reader.readLine()) != null){
            System.out.println(str);
        }
        fileInputStream.close();
        streamReader.close();
        reader.close();
    }
}
